import { getRequest, putRequest } from '@/util/httpServer';

// 采购订单列表
export const getPurchaseOrders = (data = {}) => getRequest('/api/api/purchase-orders', data, true);

// 设置状态可用/不可用
export const setPurchaseOrders = (data = {}) => {
  const { id, deleted } = data;
  return putRequest(`/api/api/purchase-orders/webDisabled/${id}?deleted=${deleted}`);
};

// 入库单-设置状态可用/不可用
export const stockInOrdersWebDisabled = (data = {}) => {
  const { id, deleted } = data;
  return putRequest(`/api/api/stock-in-orders/webDisabled/${id}?deleted=${deleted}`);
};

export const getLadingOrdersBackOrders = (data = {}) => getRequest('/api/api/lading-orders/backOrders', data, true);

// 入库单列表
export const getstockInOrders = (data = {}) => getRequest('/api/api/stock-in-orders', data, true);
// 入库单详情/编辑
export const getstockInOrdersId = (data = {}) => {
  const { id } = data;
  return getRequest(`/api/api/stock-in-orders/${id}`);
};
// 领料退回列表
export const getReturnListOrder = (data = {}) => getRequest('/api/api/getReturnListOrder', data, true);
// 入库收货列表
export const generalStockInOrders = (data = {}) => getRequest('/api/api/generalStockInOrders', data, true);
// 入库收货列表
export const getPendingAcceptOrders = (data = {}) => getRequest('/api/api/getPendingAcceptOrders', data, true);
